package com.henry.others;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class WordCnt {
    public static void main(String[] args) {
        // Finding out how many unique words are there in a line containing several words
        Scanner keyboard = new Scanner(System.in);
        String line = keyboard.nextLine();
        String[] words = line.split("\\s+");
        Set<String> uniqueWords = new HashSet<String>();
        for (String word : words) {
            uniqueWords.add(word);
        }
        System.out.println(uniqueWords);
        System.out.println(uniqueWords.size());
    }
}
